<div class="row"">
<div class="col-md-2">
    <?php include(dirname(dirname(__FILE__)).'/sidebar.phtml');?>
</div>
<div class="col-md-10">
  <form class="form-inline task" action="/manage/stat/link/" method = "GET">
    <div class="form-group">
      <label class="control-label">链接ID</label>
      <input class="form-control" name="id" type="text" placeholder="链接ID" value="<?php if(!empty($params['id'])): echo $params['id']; endif;?>">
    </div>
    <div class="form-group">
      <label class="control-label">标题</label>
      <input class="form-control" name="title" type="text" placeholder="标题" value="<?php if(!empty($params['title'])): echo $params['title']; endif;?>">
    </div>
    <button type="submit" class="btn btn-default btn-gap">搜索</button>
  </form>
  <div class="panel panel-default">
    <div class="panel-heading clearfix">
      链接统计列表
      <a class="btn btn-sm btn-success taskaddBtn" href="/manage/stat/addlink/">增加新链接</a>
    </div>
    <div style="margin: 20px 0 0 20px;">
      发送给第三方的统计链接地址为: <br/>
        <?php echo SERVER_DOMAIN;?>/jump.php?id=xxx <br/>
    </div>
    <div class="panel-body">
      <table class="table table-bordered table-striped">
        <thead>
          <tr>
            <th scope="col">ID</th>
            <th scope="col">标题</th>
            <th scope="col">点击次数</th>
            <th scope="col">激活数</th>
            <th scope="col">管理</th>
          </tr>
        </thead>
        <tbody>
        <?php foreach ($rowsets as $id => $row):?>
          <tr>
            <td><?php echo $row['id']?></td>
            <td><?php echo $row['title']?></td>
            <td><?php echo $row['clk_num'] ?></td>
            <td><?php echo $row['act_num'] ?></td>
            <td>
              <a class="btn btn-success btn-sm" href="/manage/stat/addlink/?id=<?php echo $row['id']?>">编辑</a>
              <a class="btn btn-success btn-sm" href="/manage/stat/linkstat/?stid=<?php echo $row['id']?>">详情</a> </td>
          </tr>
        <?php endforeach;?>
        </tbody>
      </table>
      <?php $pager->render();?>
    </div>
  </div>
</div>